import $GLOB from "../../../globalConfig"

//基本页面
import Home from "@/components/index/home"  //默认页面
import Charts from "@/components/index/charts" //首页

// 系统设置
import menuSet from "@/components/system/menu_set" //菜单管理
import accountSet from "@/components/system/account_set" //账户管理
import groupSet from "@/components/system/group_set" //分组管理
import logSet from "@/components/system/log_set" //日志管理
import Login from "@/components/login/index"
import err_404 from "@/components/error/404"

import $S from '@/js/common/storage'

const routes = [
    {
        path: '/',
        name: 'home',
        component: Home,
        // component: resolve => require([ '@/components/index/home' ], resolve),
        meta: {
            title: 'vue_element',
            type:'pc',
        },
        redirect:'/' + $S.Get('home'),
        children: [
            {
                path: 'charts',
                name: 'charts',
                component: Charts,
                // component: resolve => require([ '@/components/index/charts' ], resolve),
                meta: {
                    title: '数据统计-' + $GLOB.LOGIN_TITLE,
                    item_title:"数据统计",
                    type:'pc',
                }
            },

            // ===========================================  系统设置  ===============================
            {
                path: 'menu_set',
                name: 'menu_set',
                component: menuSet,
                // component: resolve => require([ '@/components/system/menu_set' ], resolve),
                meta: {
                    title: '菜单管理-' + $GLOB.LOGIN_TITLE,
                    item_title:"菜单管理",
                    type:'pc',
                }
            },
            {
                path: 'account_set',
                name: 'account_set',
                component: accountSet,
                // component: resolve => require([ '@/components/system/account_set' ], resolve),
                meta: {
                    title: '账户管理-' + $GLOB.LOGIN_TITLE,
                    item_title:"账户管理",
                    type:'pc',
                }
            },
            {
                path: 'group_set',
                name: 'group_set',
                component: groupSet,
                // component: resolve => require([ '@/components/system/group_set' ], resolve),
                meta: {
                    title: '分组管理-' + $GLOB.LOGIN_TITLE,
                    item_title:"分组管理",
                    type:'pc',
                }
            },
            {
                path: 'log_set',
                name: 'log_set',
                component: logSet,
                // component: resolve => require([ '@/components/system/log_set' ], resolve),
                meta: {
                    title: '日志管理-' + $GLOB.LOGIN_TITLE,
                    item_title:"日志管理",
                    type:'pc',
                }
            },
        ],
    },

    {
        path: '/login',
        name: 'login',
        component: Login,
        // component: resolve => require([ '@/components/login/index' ], resolve),
        meta: {
            title: '登陆-' + $GLOB.LOGIN_TITLE,
            type:'pc',
        }
    },
    {
        path: '/404',
        name: '404',
        component: err_404,
        // component: resolve => require([ '@/components/error/404' ], resolve),
        meta: {
            title: '页面不存在-' + $GLOB.LOGIN_TITLE,
            type:'pc',
        }
    }
];

//路由列表
export default {
    routes
}
